﻿[ExportTemplate]
$USING_NAMESPACES$

namespace $NAMESPACE$
{
    [DataObject(true)]
    public class $BLL_CLASS$ : BLL<$DAL_CLASS$>
    {
        #region GetOrderBy
        protected override string GetOrderBy()
        {
            return SqlFile.GetSQL("GetOrderBy");
        }
        #endregion

        #region GetSelectSQLNoOrderBy
        protected override string GetSelectSQLNoOrderBy(Hashtable Parameters)
        {
			$GetSelectSQLNoOrderByContent$
        }
        #endregion

        #region GetSelectDetailsVwSQL
        protected override string GetSelectDetailsVwSQL(Hashtable Parameters)
        {
			$GetSelectDetailsVwSQLContent$
        }
        #endregion

        #region GetInsertSQL
        public override List<string> GetInsertSQL(DAL_CLASS aRec)
        {
			$GetInsertSQLContent$
        }
        #endregion

        #region GetUpdateSQL
        public override List<string> GetUpdateSQL(DAL_CLASS aRec)
        {
			$GetUpdateSQLContent$
        }
        #endregion

        #region GetDeleteSQL
        public override List<string> GetDeleteSQL(DAL_CLASS aRec)
        {
			$GetDeleteSQLContent$
        }
        #endregion

        #region CreateDbObject
        protected override IDatabase CreateDbObject()
        {
            return new Database(DatabaseMode.$DatabaseMode$, "$ConnectionString$");
        }
        #endregion

    }
}
----------------------------------------------------------------------
[GetSelectSQLNoOrderByContent]
string sql = SqlFile.GetSQL("GetSelectSQLNoOrderBy",
				$SelectSQLNoOrderByFields$);

return sql;
----------------------------------------------------------------------
[GetSelectDetailsVwSQLContent]
string sql = SqlFile.GetSQL("GetSelectDetailsVwSQL",
				$SelectDetailsVwSQLFields$);

return sql;
----------------------------------------------------------------------
[GetInsertSQLContent]
List<string> lst = new List<string>();

string sql = SqlFile.GetSQL("GetInsertSQL");

DAL_CLASS newValue =  aRec;
DAL_CLASS oldValue =  null;

sql = Formatter.GenericFormat<DAL_CLASS>(DbType.$DbType$, 
										 sql, 
										 newValue, 
										 oldValue);
lst.Add(sql);

return lst;
----------------------------------------------------------------------
[GetUpdateSQLContent]
List<string> lst = new List<string>();

//lst.AddRange(GetDeleteSQL(aRec));
//lst.AddRange(GetInsertSQL(aRec));

string sql = SqlFile.GetSQL("GetUpdateSQL");

DAL_CLASS newValue =  aRec;
DAL_CLASS oldValue =  OldRec;

sql = Formatter.GenericFormat<DAL_CLASS>(DbType.$DbType$, 
										 sql, 
										 newValue, 
										 oldValue);
lst.Add(sql);

return lst;
----------------------------------------------------------------------
[GetDeleteSQLContent]
List<string> lst = new List<string>();

string sql = SqlFile.GetSQL("GetDeleteSQL");

DAL_CLASS newValue =  aRec;
DAL_CLASS oldValue =  OldRec;

sql = Formatter.GenericFormat<DAL_CLASS>(DbType.$DbType$, 
										 sql, 
										 newValue, 
										 oldValue);

lst.Add(sql);

return lst;
----------------------------------------------------------------------